package fzu.functiongather;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

import fzu.functiongather.BottomTab.BottomTabActivity;
import fzu.functiongather.CarouselPicture.CarouselPictureActivity;
import fzu.functiongather.CircleImageView.CircleImageViewActivity;
import fzu.functiongather.Code.CodeActivity;
import fzu.functiongather.DrawerMenu.DrawerMenuActivity;
import fzu.functiongather.DropDownMenu.DropDownMenuActivity;
import fzu.functiongather.MainPage.PageActivity;
import fzu.functiongather.MultipleChoice.MultipleChoiceActivity;
import fzu.functiongather.ProgressBar.ProgressBarActivity;
import fzu.functiongather.PullToRefresh.PullToRefreshActivity;
import fzu.functiongather.QRCode.QRCodeActivity;
import fzu.functiongather.QRCode_Creat.QRCode_Creat_Activity;
import fzu.functiongather.RightPop.RightPopActivity;
import fzu.functiongather.SectorMenu.SectorMenuActivity;
import fzu.functiongather.Select.SelectActivity;
import fzu.functiongather.Select.SelectTwoActivity;
import fzu.functiongather.ShareAddress.ShareAddressActivity;
import fzu.functiongather.TimerCount.TimerCountActivity;


/**
 * Created by RuiyuHuang on 2016/7/14 0014.
 */
public class MainActivity extends BaseActivity implements AdapterView.OnItemClickListener{

    private List<String> mList;
    private ListView lv_main;
    private ArrayAdapter<String> mAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        initData();
    }

    private void initView() {
        lv_main = (ListView) findViewById(R.id.lv_main);
        mList = new ArrayList<String>();
        mAdapter = new ArrayAdapter<String> (MainActivity.this,android.R.layout.simple_list_item_1,mList);
        lv_main.setOnItemClickListener(this);

    }

    private void initData() {
        mList.add("顶部滑动指示器");
        mList.add("进度条");
        mList.add("底部左右滑动导航");
        mList.add("侧滑菜单");
        mList.add("二维码扫描");
       /* mList.add("分享");*/
        mList.add("本地验证码");
        mList.add("生成二维码");
        mList.add("倒计时");
        mList.add("复制文字");
        mList.add("一级选择");
        mList.add("二级选择");
        mList.add("轮播图");
        mList.add("右弹框");
        mList.add("底部扇形展开菜单");
        mList.add("圆形头像");
        mList.add("下拉菜单");
        mList.add("多图选择上传");
        mList.add("上拉加载更多，下拉刷新");
        lv_main.setAdapter(mAdapter);
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
      /*  ToastUtils.show(MainActivity.this,"fdsf" + position,10);*/
        Intent intent = null;
        switch (position) {
            case 0: intent = new Intent(MainActivity.this,PageActivity.class);
                break;
            case 1: intent = new Intent(MainActivity.this, ProgressBarActivity.class);
                break;
            case 2: intent = new Intent(MainActivity.this, BottomTabActivity.class);
                break;
            case 3: intent = new Intent(MainActivity.this, DrawerMenuActivity.class);
                break;
            case 4: intent = new Intent(MainActivity.this, QRCodeActivity.class);
                break;
          /*  case 5: intent=new Intent(MainActivity.this, ShareActivity.class);
                break;*/
            case 5:intent=new Intent(MainActivity.this, CodeActivity.class);
                   break;
            case 6:intent=new Intent(MainActivity.this, QRCode_Creat_Activity.class);
                break;
            case 7:intent=new Intent(MainActivity.this,TimerCountActivity.class);
                break;
            case 8:intent=new Intent(MainActivity.this, ShareAddressActivity.class);
                break;
            case 9:intent=new Intent(MainActivity.this, SelectActivity.class);
                break;
            case 10:intent=new Intent(MainActivity.this, SelectTwoActivity.class);
                break;
            case 11:intent=new Intent(MainActivity.this, CarouselPictureActivity.class);
                break;
            case 12:intent=new Intent(MainActivity.this, RightPopActivity.class);
                break;
            case 13:intent=new Intent(MainActivity.this, SectorMenuActivity.class);
                break;
            case 14:intent=new Intent(MainActivity.this, CircleImageViewActivity.class);
                break;
            case 15:intent=new Intent(MainActivity.this, DropDownMenuActivity.class);
                break;
            case 16:intent=new Intent(MainActivity.this, MultipleChoiceActivity.class);
                break;
            case 17:intent=new Intent(MainActivity.this, PullToRefreshActivity.class);
                break;
        }
        startActivityForResult(intent,0);
    }
}
